 /// @file ReaderTopoConvertHelper.h
 /// @brief ReaderTopoConvertHelper 
 /// @copyright Copyright (c) 2025  Hefei Jiushao Intelligent Technology Co., Ltd. All rights reserved.
 /// @createtime 2025-02-18

#ifndef READERTOPOCONVERTHELPER_H
#define READERTOPOCONVERTHELPER_H
#include "common/constant.h"
#include "common/PointT.hpp"
#include <topology/TopoEdge.hpp>
#include <topology/TopoFace.hpp>
#include <topology/TopoWire.hpp>

#include "position.hxx"

#include "coedge.hxx"

#include "bs3curve.hxx"

AMCAX_EXCHANGE_NAMESPACE_BEGIN

namespace  InterOp::ReaderGeometryConvertHelper{
    AMCAX::Point3 ConvertPoint(const SPAposition &position) ;

    void ConvertKnotAndMult(const std::vector<double> &input,
        std::vector<double> &newKnot, std::vector<int> &newMult) ;

    void GetBsplineParameters(const FACE *face) ;

    void GetBcurveParameters(const bs3_curve *appox_cur) ;
}

namespace  InterOp::ReaderTopoConvertHelper{
    AMCAX::TopoEdge ConvertCoedge(const COEDGE *coedge,bool coedgeReverse = false);
    AMCAX::TopoEdge ConvertEdge(const EDGE *edge,bool coedgeReverse = false,bool edgeReverse = false);

    AMCAX::TopoEdge ConvertStraightLine(const EDGE *edge,bool coedgeReverse=false,bool edgeReverse=false);
    AMCAX::TopoEdge ConvertCircle(const EDGE *edge,bool coedgeReverse=false,bool edgeReverse=false);
    AMCAX::TopoEdge ConvertEllipse(const EDGE *edge,bool coedgeReverse=false,bool edgeReverse=false);
    AMCAX::TopoEdge ConvertHelix(const EDGE *edge,bool coedgeReverse=false,bool edgeReverse=false);
    AMCAX::TopoEdge ConvertIntcurve(const EDGE *edge,bool coedgeReverse=false,bool edgeReverse=false);
    AMCAX::TopoEdge ConvertEdgeFromBs3curve(const bs3_curve *curve);

    // AMCAX::SurfaceType
    AMCAX::TopoFace ConvertFace(const FACE *face, AMCAX::TopoWire *outer = nullptr);

    AMCAX::TopoFace ConvertPlane(const FACE *face, AMCAX::TopoWire *outer = nullptr);
    AMCAX::TopoFace ConvertCylinder(const FACE *face, AMCAX::TopoWire *outer = nullptr);
    AMCAX::TopoFace ConvertCone(const FACE *face, AMCAX::TopoWire *outer = nullptr);
    AMCAX::TopoFace ConvertSphere(const FACE *face, AMCAX::TopoWire *outer = nullptr);
    AMCAX::TopoFace ConvertTorus(const FACE *face, AMCAX::TopoWire *outer = nullptr);
    AMCAX::TopoFace ConvertBsurface(const FACE *face, AMCAX::TopoWire *outer = nullptr);
}

AMCAX_EXCHANGE_NAMESPACE_END

#endif